'use strict';
exports.main = async (event, context) => {
	//event为客户端上传的参数
	console.log('event : ', event);
	const db = uniCloud.database({});
	const shop = db.collection('db_user')

	let dd;
	await shop.where({
		acc: event.acc,
		pwd: event.pwd
	}).get().then(res => {
		dd = res.data
	})
	//返回数据给客户端
	if (dd.length > 0) {
		return {
			code: 200,
			msg: "登陆成功",
			dd
		}
	} else {
		return {
			code: 201,
			msg: "账号或密码错误"
		}
	}
};